home *** CD-ROM | disk | FTP | other *** search
- head 1.5;
- branch ;
- access ;
- symbols ;
- locks ; strict;
- comment @ * @;
-
-
- 1.5
- date 89.08.15.19.55.52; author rab; state Exp;
- branches ;
- next 1.4;
-
- 1.4
- date 88.09.28.11.49.48; author mendel; state Exp;
- branches ;
- next 1.3;
-
- 1.3
- date 88.08.16.11.22.20; author mendel; state Exp;
- branches ;
- next 1.2;
-
- 1.2
- date 88.04.27.09.15.38; author brent; state Exp;
- branches ;
- next 1.1;
-
- 1.1
- date 88.04.27.09.02.08; author brent; state Exp;
- branches ;
- next ;
-
-
- desc
- @TCP Timer defs
- @
-
-
- 1.5
- log
- @Commented #endif labels.
- @
- text
- @/*
- * tcpTimer.h --
- *
- * Definitions of timers for the TCP protocol.
- *
- * Based on 4.3BSD @@(#)tcp_timer.h 7.5 (Berkeley) 3/16/88
- *
- * Copyright 1987 Regents of the University of California
- * All rights reserved.
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies. The University of California
- * makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without
- * express or implied warranty.
- *
- * $Header: /sprite/src/daemons/ipServer/RCS/tcpTimer.h,v 1.4 88/09/28 11:49:48 mendel Exp Locker: rab $ SPRITE (Berkeley)
- */
-
- #ifndef _IPS_TCP_TIMER
- #define _IPS_TCP_TIMER
- /*
- * Definitions of the 4 TCP timers:
- *
- * The TCP_TIMER_REXMT timer is used to force retransmissions. The TCB
- * has the TCP_TIMER_REXMT timer set whenever segments have been sent for
- * which ACKs are expected but not yet received. If an ACK is received
- * that advances tcbPtr->send.unAck, then the retransmit timer is cleared (if
- * there are no more outstanding segments) or reset to the base value (if
- * more ACKs are expected). Whenever the retransmit timer goes off,
- * we retransmit one unacknowledged segment, and do a backoff on the
- * retransmit timer.
- *
- * The TCP_TIMER_PERSIST timer is used to keep window size information
- * flowing even if the window goes shut. If all previous transmissions
- * have been acknowledged (so that there are no retransmissions in
- * progress), and the window is too small to bother sending anything, then
- * we start the TCP_TIMER_PERSIST timer. When it expires, if the window
- * is nonzero, we go into the transmit state. Otherwise, at intervals, send a
- * single byte into the peer's window to force him to update our window
- * information. We do this at most as TCP_MIN_PERSIST_TIME time
- * intervals, but no more frequently than the current estimate of
- * round-trip packet time. The TCP_TIMER_PERSIST timer is cleared
- * whenever we receive a window update from the peer.
- *
- * The TCP_TIMER_KEEP_ALIVE timer is used to keep connections alive. If a
- * connection is idle (no segments received) for TCP_KEEP_TIME_INIT amount
- * of time, but not yet established, then we drop the connection. Once
- * the connection is established, if the connection is idle for
- * TCP_KEEP_TIMER_IDLE time (and keepalives have been enabled on the
- * socket), we begin to probe the connection. We force the peer to send
- * us a segment by sending:
- * <SEQ=SEND.UNACK-1><ACK=RECV.NEXT><CTL=ACK>
- * This segment is (deliberately) outside the window, and should elicit an
- * ack segment in response from the peer. If, despite the
- * TCP_TIMER_KEEP_ALIVE initiated segments we cannot elicit a response
- * from a peer after TCP_KEEP_COUNT times, then we drop the connection.
- */
-
- #define TCP_NUM_TIMERS 4
-
- #define TCP_TIMER_REXMT 0 /* retransmit */
- #define TCP_TIMER_PERSIST 1 /* retransmit persistence */
- #define TCP_TIMER_KEEP_ALIVE 2 /* keep alive */
- #define TCP_TIMER_2MSL 3 /* 2*msl quiet time timer */
-
- #ifdef TCP_TIMER_NAMES
- char *tcpTimers[] =
- { "REXMT", "PERSIST", "KEEP ALIVE", "2MSL" };
- #endif
-
- /*
- * Number of times per second to update timers.
- */
-
- #define TIMER_UPDATE_RATE 2
- /*
- * Time constants: (In timer ticks)
- *
- * TCP_MSL_TIME - maximum segment lifetime.
- * TCP_SRTT_BASE_TIME - base roundtrip time; if 0, no idea yet.
- * TCP_SRTT_DEFLT_TIME - assumed RTT if no info.
- * TCP_KEEP_TIME_INIT - initial connect keep-alive time.
- * TCP_KEEP_TIME_IDLE - default time before probing.
- * TCP_KEEP_TIME_INTVL - default proble interval.
- * TCP_MIN_PERSIST_TIME - retransmit persistence.
- * TCP_MAX_PERSIST_TIME - maximum retransmit persistence.
- * TCP_MIN_REXMT_TIME - minimum allowable value for retransmit timer.
- * TCP_MAX_REXMT_TIME - maximum allowable value for retrans. and persist
- * timers.
- *
- * Other constants:
- * TCP_MAX_RXT_SHIFT - maximum number of retransmissions.
- * TCP_KEEP_COUNT - max. # of probes before we drop the connection.
- */
-
- #define TCP_MSL_TIME (30 * TIMER_UPDATE_RATE)
- #define TCP_SRTT_BASE_TIME (0 * TIMER_UPDATE_RATE)
- #define TCP_SRTT_DEFLT_TIME (3 * TIMER_UPDATE_RATE)
-
- #define TCP_KEEP_TIME_INIT (75 * TIMER_UPDATE_RATE)
- #define TCP_KEEP_TIME_IDLE ((120*60) * TIMER_UPDATE_RATE)
- #define TCP_KEEP_TIME_INTVL (75 * TIMER_UPDATE_RATE)
-
- #define TCP_MIN_PERSIST_TIME (5* TIMER_UPDATE_RATE)
- #define TCP_MAX_PERSIST_TIME (60 * TIMER_UPDATE_RATE)
-
- #define TCP_MIN_REXMT_TIME ( 1 * TIMER_UPDATE_RATE)
- #define TCP_MAX_REXMT_TIME (64 * TIMER_UPDATE_RATE)
-
- #define TCP_KEEP_COUNT 8
- #define TCP_MAX_RXT_SHIFT 12
-
- extern int tcpKeepIdle;
- extern int tcpKeepIntvl;
- extern int tcpMaxIdle;
-
- /*
- * A macro to force a time value to be in a certain range.
- */
- #define TCP_TIMER_RANGESET(tv, value, tvmin, tvmax) { \
- (tv) = (value); \
- if ((tv) < (tvmin)) { \
- (tv) = (tvmin); \
- } else if ((tv) > (tvmax)) { \
- (tv) = (tvmax); \
- } \
- }
- #endif /* _IPS_TCP_TIMER */
- @
-
-
- 1.4
- log
- @Bug fixes and a patch for SPUR.
- @
- text
- @d18 1
- a18 1
- * $Header: tcpTimer.h,v 1.3 88/08/16 11:22:20 mendel Exp $ SPRITE (Berkeley)
- d54 1
- a54 1
- * <SEQ=SEND.UNACK-1><ACK=RECV.NEXT><CTL=ACK>
- d90 1
- a90 1
- * TCP_MAX_REXMT_TIME - maximum allowable value for retrans. and persist
- d130 1
- a130 1
- #endif _IPS_TCP_TIMER
- @
-
-
- 1.3
- log
- @Converted to new lib.a.
- @
- text
- @d18 1
- a18 1
- * $Header: tcpTimer.h,v 1.2 88/04/27 09:15:38 brent Exp $ SPRITE (Berkeley)
- d74 6
- a79 1
- * Time constants: (In seconds)
- d98 3
- a100 3
- #define TCP_MSL_TIME 30
- #define TCP_SRTT_BASE_TIME 0
- #define TCP_SRTT_DEFLT_TIME 3
- d102 3
- a104 3
- #define TCP_KEEP_TIME_INIT 75
- #define TCP_KEEP_TIME_IDLE (120*60)
- #define TCP_KEEP_TIME_INTVL 75
- d106 2
- a107 2
- #define TCP_MIN_PERSIST_TIME 5
- #define TCP_MAX_PERSIST_TIME 60
- d109 2
- a110 2
- #define TCP_MIN_REXMT_TIME 1
- #define TCP_MAX_REXMT_TIME 64
- @
-
-
- 1.2
- log
- @New version with Jacobson enhancements
- @
- text
- @d18 1
- a18 1
- * $Header: tcpTimer.h,v 6.1 88/04/24 23:15:14 andrew Exp $ SPRITE (Berkeley)
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d6 1
- a6 1
- * Based on 4.3BSD @@(#)tcp_timer.h 7.2 (Berkeley) 6/4/87
- d18 1
- a18 1
- * $Header: tcpTimer.h,v 6.0 87/09/08 15:58:17 andrew Stable $ SPRITE (Berkeley)
- d47 12
- a58 10
- * The TCP_TIMER_KEEP_ALIVE timer is used to keep connections alive. If
- * an connection is idle (no segments received) for TCP_KEEP_TIME
- * amount of time, but not yet established, then we drop the connection.
- * If the connection is established, then we force the peer to send us a
- * segment by sending:
- * <SEQ=SEND.UNACK-1><ACK=RECV.NEXT><CTL=ACK>
- * This segment is (deliberately) outside the window, and should elicit
- * an ACK segment response from the peer. If, despite the
- * TCP_TIMER_KEEP_ALIVE initiated segments we cannot elicit a response from
- * a peer in TCP_MAX_IDLE_TIME amount of time, then we drop the connection.
- d74 1
- a74 1
- * Time constants:
- d79 3
- a81 1
- * TCP_KEEP_TIME - keep alive.
- d83 1
- a83 2
- * TCP_MAX_IDLE_TIME - maximum allowable idle time before we drop the
- * connection.
- d88 1
- d90 1
- d93 1
- a93 1
- #define TCP_MSL_TIME 15
- d97 4
- a100 2
- #define TCP_KEEP_TIME 45
- #define TCP_MAX_IDLE_TIME (8 * TCP_KEEP_TIME)
- d102 1
- d105 1
- a105 1
- #define TCP_MAX_REXMT_TIME 30
- d107 2
- a108 1
- #define TCP_MAX_RXT_SHIFT 12
- d110 3
- a114 27
- * Retransmission smoothing constants. Smoothed round trip time is updated by
- *
- * tcpPtr->smoothRTT = (tcp_SmoothAlpha * tcpPtr->smoothRTT) +
- * ((1 - tcp_SmoothAlpha) * tcpPtr->roundTripTime);
- *
- * each time a new value of tp->roundTripTime is available. The initial
- * retransmit timeout is then based on
- *
- * tcpPtr->timer[TCP_TIMER_REXMT] = tcp_SmoothBeta * tcpPtr->smoothRTT;
- *
- * limited, however to be at least TCP_MIN_REXMT_TIME and at most
- * TCP_MAX_REXMT_TIME.
- */
-
- extern float tcpSmoothAlpha;
- extern float tcpSmoothBeta;
-
- /*
- * Initial values of tcp_SmoothAlpha and tcp_SmoothBeta:
- * These are conservative: averaging over a long period of time, and
- * allowing for large individual deviations from tcpPtr->smoothRTT.
- */
-
- #define TCP_SMOOTH_ALPHA 0.9
- #define TCP_SMOOTH_BETA 2.0
-
- /*
- d121 1
- a121 2
- } \
- if ((tv) > (tvmax)) { \
- @
-